#include<stdio.h>
#include<math.h>
int isPrime(int x)
{
	int i = 2;
	while (i <= (int)sqrtf(x))
	{
		if (x % i == 0)
			return 0;
		else
			i++;
	}
	return 1;
}
int main()
{
	int n, x, sum = 0;
	scanf("%d", &n);
	int a[100000];
	int i = 0;
	for (x = 2; x <= n; x++)
	{
		if (isPrime(x) == 1)
		{
			a[i] = x;
			i++;
		}
	}
	for (int j = 0; j < i; j++) {
		if (a[j + 1] - a[j] == 2)
		{
			sum++;
		}
	}
	printf("%d", sum);
	return 0;
}